package behavior.observer.impl;

import java.util.ArrayList;
import java.util.List;

import behavior.observer.MessageSender;
import behavior.observer.SystemMessage;

public class SystemMessageImpl implements SystemMessage {

	private List<MessageSender> senders = new ArrayList<MessageSender>();

	@Override
	public void addSender(MessageSender sender) {
		senders.add(sender);
	}

	@Override
	public void removeSender(MessageSender sender) {
		senders.remove(sender);
	}

	@Override
	public void notifySendMessage(String msg) {
		for (MessageSender sender : senders) {
			sender.send(msg);
		}
	}

}
